<?php
namespace app\model;
class User extends Common
{
     const  USER_STATUS_ACTIVE = 1;
     const  USER_STATUS_INACTIVE = -1;
    public function setPasswordAttr($password)
     {
        return password_hash($password,PASSWORD_DEFAULT);
     }


    public function roles()
    {
        return $this->belongsToMany(Role::class, 'user_role');
    }
}